package com.tengju.bff.interfaces.covercharge.constant;

/**
 * 周期表状态枚举类
 *
 * @author cj
 */
public enum ServiceWithdarwCycleAddEnum {
    NOT_PAY(0, "未打款"),
    HAVE_PAY(2, "已打款"),
    PAY_FAILURE(5, "打款失败");

    private Integer code;
    private String desc;

    ServiceWithdarwCycleAddEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getDesc() {
        return this.desc;
    }

    public static ServiceWithdarwCycleAddEnum getStatusDesc (Integer code){
        for(ServiceWithdarwCycleAddEnum statusEnum : (ServiceWithdarwCycleAddEnum.values())){
            if(statusEnum.getCode().equals(code)){//如果传入的code与此枚举code相同，则返回此枚举
                return statusEnum;
            }
        }
        return null;
    }
}
